import request from '@/utils/request'
/**
 *
 * 动态管理
 *
 **/
// 查询列表接口
export const getTrendsPage = (params: any) => {
  return request({
    url: '/trends/page',
    method: 'get',
    params
  })
}

// 删除接口
export const deleteTrends = (ids: string) => {
  return request({
    url: '/trends',
    method: 'delete',
    params: { ids }
  })
}

// 修改接口
export const editTrends = (params: any) => {
  return request({
    url: '/trends',
    method: 'put',
    data: { ...params }
  })
}

// 新增接口
export const addTrends = (params: any) => {
  return request({
    url: '/trends',
    method: 'post',
    data: { ...params }
  })
}

// 查询详情
export const queryTrendsById = (id: string | (string | null)[]) => {
  return request({
    url: `/trends/${id}`,
    method: 'get'
  })
}


// 文件down预览
export const commonDownload = (params: any) => {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
    },
    url: '/common/download',
    method: 'get',
    params
  })
}

